A Formal Model and Specification Language for Procedure Calling Conventions 1

نویسنده

  • Mark W. Bailey Jack W. Davidson
چکیده

Procedure calling conventions are used to provide uniform procedure call interfaces. Applications, such as compilers and debug-gers, which generate, or process procedures at the machine-language abstraction level require knowledge of the calling convention. In this paper, we develop a formal model for procedure calling conventions called P-FSA's. Using this model, we are able to ensure several completeness and consistency properties of calling conventions. Currently, applications that manipulate procedures implement conventions in an ad-hoc manner. The resulting code is complicated with details, difficult to maintain, and often riddled with errors. To alleviate the situation, we introduce a calling convention specification language, called CCL. The combination of CCL and P-FSA's facilitates the accurate specification of conventions that can be shown to be both consistent and complete. 1 Introduction Procedures, or functions, in programming languages work in concert to implement the intended function of programs. To facilitate this cooperation between procedures, we must accurately specify the procedure-call interface. This interface must define how to pass actual parameters and describe function return values, and which machine resources, such as registers, the called procedure must preserve. This understanding between the caller 2 and callee 3 is known as the procedure calling convention. Because of the machine-specific nature of the calling convention, calling conventions vary widely from machine-to-machine, programming-language to programming language , and,

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Construction of Systems Software Using Specifications of Procedure Calling Conventions

The procedure calling convention impacts the operation of many system software components. The interface between procedures, which is established by the calling convention, facilitates separate compilation of program modules and interoperability of programming languages. The procedure calling convention dictates the way that program values are communicated, and how machine resources are shared ...

متن کامل

A Formal Model and Specification Language for Procedure Calling Conventions

ly, data placement definitions are functions that map values onto machine resources. The functions take a value and corresponding attributes (such as data type) and decide where the value belongs. More precisely, placement definitions are finite state machines, since the mapping is order-dependent. Figure 2 illustrates an application of a placement definition to place procedure arguments. In th...

متن کامل

Staged Allocation: Engineering the Specification and Implementation of Procedure Calling Conventions

We present staged allocation, a new technique for specifying calling conventions. A specification written using staged allocation has a precise, formal semantics, and it can be executed directly inside a compiler. An implementation takes about 250 lines of ML or 650 lines of C++. Descriptions of nine calling conventions range in size from 15 to 30 lines each.

متن کامل

Custom Calling Conventions in a Portable Assembly Language

Calling conventions are so difficult to implement and maintain that people rarely experiment with alternatives. The primary sources of difficulty appear to be parameter passing and stack-frame layout. To implement parameter passing, we use the automata developed by Bailey and Davidson, but we have developed a new specification language that is implementable directly in the compiler. To implemen...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995